package com.fr.report.script.function;

import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class LOWER extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject.length < 1)
      return Primitive.ERROR_NAME;
    Object localObject = paramArrayOfObject[0];
    if (localObject != null)
      return "" + localObject.toLowerCase();
    return null;
  }

  public Function.Type getType()
  {
    return Function.TEXT;
  }

  public String getCN()
  {
    return "LOWER(text): 将所有的大写字母转化为小写字母。\nText:需要转化为小写字母的文本串。LOWER函数不转化文本串中非字母的字符。\n示例:\nLOWER(\"A.M.10:30\")等于“a.m.10:30”。\nLOWER(\"China\")等于“china”。";
  }

  public String getEN()
  {
    return "LOWER(text): Converts all uppercase letters in a text string to lowercase.\nText is the text you want to convert to lowercase. LOWER does not change characters in text that are not letters.\n\nExample:\n   LOWER(\"A.M.10:30\") = \"a.m.10:30\"\n   LOWER(\"China\") = \"china\"";
  }
}